#include<stdio.h>
//反转
int reverse(int num){
    int reminder,reversedInteger=0;
    while(num!=0){
        reminder = num%10;
        reversedInteger = reversedInteger*10+reminder;
        num/=10;
    }
    return reversedInteger;
}
//每步的操作
int fun(int num){
        return reverse(num)+num;
}
int main(){
    int step=0,num;
    scanf("%d",&num);
    while(step<30){
        step++;
        if (fun(num) == reverse(fun(num)))
        {
            printf("step=%d", step);
            return 0;
        }
        num=fun(num);
    }
    printf("Impossoble!");
    return 0;
}